//
//  KYSimultaneousModel.m
//  kuaiyi
//
//  Created by 杨亮 on 16/3/15.
//  Copyright © 2016年 kuaiyi. All rights reserved.
//

#import "KYSimultaneousModel.h"
#import "KYNetTool.h"
#import <MJExtension.h>

@implementation KYSimultaneousModel
+(void)getSimultaneousModelSuccess:(void(^)(NSArray *simultaneousModel))success{
    NSString *url = @"http://iosapi.itcast.cn/complicationList.json.php";
    NSDictionary *paramDic = @{@"login_token":@"985c96ce43bb5ef69de3e1ad8afaa83f",@"page":@(1),@"page_size":@(15),@"ci2_id":@(3)};
    [[KYNetTool shareManager]POST:url parameters:paramDic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
            NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
            NSArray *array = dict[@"data"];
            NSMutableArray *arr = [NSMutableArray array];
            for (NSDictionary *ArrayDict in array) {
                KYSimultaneousModel *model = [KYSimultaneousModel mj_objectWithKeyValues:ArrayDict];
                [arr addObject:model];
            }
            if (success) {
                success(arr.copy);
            }
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"%@",error.description);
    }];
}
@end
